package com.qf.day3.work;

import java.sql.Array;
import java.util.ArrayList;

public class Work2 {
    private static  void splitTwoNum(int n) {
        ArrayList<Integer> list = new ArrayList<>();
        for (int i = 2; i <=n; i++) {
            boolean flag = true;
            for (int j = 2; j <i ; j++) {
                if(i%j==0){
                    //i不是质数
                    flag = false;
                    break;
                }
            }
            if(flag){
                list.add(i);
            }
        }
        for (int k = 0; k < list.size(); k++) {
            for (int i = 0; i < list.size()/2+1; i++) {
                if(list.get(i)+ list.get(k) == n){
                    System.out.println(list.get(i)+" "+ list.get(k));
                }
            }
        }
    }

    public static void main(String[] args) {
        int num = 14;
        splitTwoNum(num);
    }
}
